% try fmincon

fun = @(x) 100*(x(2)-x(1)^2)^2 + (1-x(1))^2;

x0 = [-1,2];
A = [1,2];
b = 1;
x = fmincon(fun,x0,A,b)

sqr = @(x) x.^2
a = sqr([1, 2, 3])